﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WsdShop.Model;
using WsdShop.Model.SearchModels.DropGroup;
using WsdShop.Model.ViewModels;

namespace WsdShop.IService
{
    public interface IDropGroupService
    {
        /// <summary>
        /// 分页获取活动列表
        /// </summary>
        /// <param name="search"></param>
        /// <param name="total"></param>
        /// <returns></returns>
        IEnumerable<V_DropGroup> GetDropGroupList(DropGroupSearchModel search, ref int total);

        /// <summary>
        /// 获取所有在时间内的活动
        /// </summary>
        /// <returns></returns>
        List<V_DropGroup> GetDropGroupListAll();


        /// <summary>
        /// 更新活动状态
        /// </summary>
        /// <param name="id"></param>
        /// <param name="state"></param>
        /// <returns></returns>
        bool UpdateDropGroupState(int id, int state);


        /// <summary>
        /// 删除活动
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        bool DelDropGroup(int id);


        /// <summary>
        /// 查询详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        V_DropGroup GetVDropGroupInfo(int id);

        /// <summary>
        /// 查询详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        V_DropGroup GetGropGroupTop1();

      
        /// <summary>
        /// 验证活动名称是否存在
        /// </summary>
        /// <param name="id"></param>
        /// <param name="title"></param>
        /// <returns></returns>
        bool CheckTitle(int id, string title);


        /// <summary>
        /// 获取活动信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Model.DropGroup GetDropGroupInfo(int id);

        /// <summary>
        /// 修改活动
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        bool EditDropGroup(Model.DropGroup model);


        /// <summary>
        /// 增加活动
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        int AddDropGroup(Model.DropGroup model);

        #region 降拼团
        GroupHead FindGroupHead(int id);
        #endregion
    }
}
